<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>社区团购</title>
    <script src="js/axios.min.js"></script>
    <script src="js/jquery-1.11.3.min.js"></script>
    <script src="js/vue.js"></script>
    <script src="layui/layui.js"></script>
    <script src="js/vue-router.js"></script>
    <!--    主要替换的地方就是css和最下面的js文件-->
    <link rel="stylesheet" href="layui/css/layui.css"/>
    <link rel="stylesheet" href="css/user.css"/>
    <link rel="stylesheet" href="css/goods_list_item.css"/>
</head>
<body>
<div id="app">
    <form class="layui-form layui-form-pane" action="">
        <div class="layui-form-item" pane>
            <label class="layui-form-label">公告标题</label>
            <div class="layui-input-block">
                <input type="text" name="title" id="title" lay-verify="required" required  placeholder="请输入标题" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">公告内容</label>
            <div class="layui-input-block" pane>
                <textarea name="desc" id="desc" required placeholder="请输入内容" class="layui-textarea"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block" style="margin-right: 70px">
                <button class="layui-btn"  onclick="submitNotice()">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
<script>


    function submitNotice(){

        let title = document.getElementById("title").value;
        let desc = document.getElementById("desc").value;

        $.get("http://47.94.138.204:7790/admin/notice", { title: title, content: desc, oid : 6 },
            function(data){
                alert("Data Loaded: " + data);
            });


    }

</script>
</body>
</html>